﻿using System;
using System.Collections.Generic;
using System.Text;
using Geometry;
using RobotRace.Geometry;

namespace RobotRace.environment.objects
{
    public class Wall2D
    {
        public Point2D firstPoint;
        public Point2D secondPoint;

        public Wall2D(Point2D firstPoint, Point2D secondPoint)
        {
            this.firstPoint = firstPoint;
            this.secondPoint = secondPoint;
        }

        public double getMinX()
        {
            return firstPoint.x < secondPoint.x ? firstPoint.x : secondPoint.x;
        }

        public double getMaxX()
        {
            return firstPoint.x > secondPoint.x ? firstPoint.x : secondPoint.x;
        }

        public double getMinY()
        {
            return firstPoint.y < secondPoint.y ? firstPoint.y : secondPoint.y;
        }

        public double getMaxY()
        {
            return firstPoint.y > secondPoint.y ? firstPoint.y : secondPoint.y;
        }

        public override string ToString()
        {
            return "Wall: (" + firstPoint.x + ", " + firstPoint.y + ") - (" + secondPoint.x + ", " + secondPoint.y + ")";
        }
    }
}
